package de.tuberlin.dima.minidb.impl;


import de.tuberlin.dima.minidb.api.ExtensionFactory;
import de.tuberlin.dima.minidb.catalogue.TableSchema;
import de.tuberlin.dima.minidb.impl.parser.ParserImpl;
import de.tuberlin.dima.minidb.impl.tablePage.TablePageImpl;
import de.tuberlin.dima.minidb.io.PageFormatException;
import de.tuberlin.dima.minidb.io.tables.TablePage;
import de.tuberlin.dima.minidb.parser.SQLParser;


/**
 * Actual implementation of the <code>ExtensionFactory</code> for this set of implementations.
 */
public class ExtensionFactoryImpl extends ExtensionFactory
{

	/* (non-Javadoc)
	 * @see de.tuberlin.dima.minidb.api.ExtensionFactory#getParser()
	 */
	public SQLParser getParser(String statement)
	{
		return new ParserImpl(statement); 
	}

	@Override
	public TablePage createTablePage(TableSchema schema, byte[] binaryPage)
			throws PageFormatException {
		// TODO Auto-generated method stub
		return new TablePageImpl(schema, binaryPage);
	}

	@Override
	public TablePage initTablePage(TableSchema schema, byte[] binaryPage,
			int newPageNumber) throws PageFormatException {
		// TODO Auto-generated method stub
		return new TablePageImpl(schema, binaryPage, newPageNumber);
	}


}
